package com.xinke.edu.mypetadoption.fragment3.adpter;

import android.content.Context;
import android.view.ViewGroup;
import android.widget.LinearLayout;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.chad.library.adapter4.BaseQuickAdapter;
import com.chad.library.adapter4.viewholder.QuickViewHolder;
import com.xinke.edu.mypetadoption.R;
import com.xinke.edu.mypetadoption.entity.Orders;
import com.xinke.edu.mypetadoption.entity.ProductInfoDTO;

public class SdTypeAdpter extends BaseQuickAdapter<ProductInfoDTO, QuickViewHolder> {

    @Override
    protected void onBindViewHolder(@NonNull QuickViewHolder quickViewHolder, int i, @Nullable ProductInfoDTO productInfoDTO) {

        // 商品名称
        quickViewHolder.setText(R.id.shmc, productInfoDTO.getProductName());

        // 店铺名称
        quickViewHolder.setText(R.id.shdp, productInfoDTO.getMerchantName());

        // 商品价格，加上货币符号
        quickViewHolder.setText(R.id.shjg, String.format("%.2f $", productInfoDTO.getPrice()));

        // 商品审核状态
        quickViewHolder.setText(R.id.shzt, productInfoDTO.getStatus());


    }

    @NonNull
    @Override
    protected QuickViewHolder onCreateViewHolder(@NonNull Context context, @NonNull ViewGroup viewGroup, int i) {
        return new QuickViewHolder(R.layout.item_type4,viewGroup);
    }

}
